<?php

namespace app\api\validate;

use think\Validate;

/**
 * 计划任务
 */
class PatrolValidate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'captain_id' => 'require',
        'starttime' => 'require',
        'endtime' => 'require',
        'name' => 'require',
        'content' => 'require',
        'patrol_inspection_id' => 'require',
        'shop_id' => 'require',
        'startstatus' => 'require',
        'is_make' => 'require|in:1,2',
    ];

    protected $message = [
        'id.require' => '未知任务',
        'name.require' => '请选择任务名称',
        'content.require' => '请选择任务描述',
        'captain_id.require' => '请选择执法巡查队长',
        'starttime.require' => '请选择执计划开始时间',
        'endtime.require' => '请选择执计划结束时间',
        'patrol_inspection_id.require' => '街道不能为空',
        'shop_id.require' => '巡查商户不能为空',
        'startstatus.require' => '巡查类型不能为空',
        'is_make.require' => '任务类型不能为空',
        'is_make.in' => '任务类型未知',
    ];

    protected $scene = [
        'add' => ['name', 'content', 'captain_id', 'starttime', 'endtime',
            'patrol_inspection_id', 'shop_id','startstatus'],
        'save' => ['id','name', 'content', 'captain_id', 'starttime', 'endtime',
            'patrol_inspection_id', 'shop_id'],
        'save_status' => ['id'],
        'save_enforce' => ['id','user_staff_id'],
    ];
}